import os
path = os.getcwd()+"\\サクラメントの十二宫 乱れる仔ひつじと手懐く狼\\" #path
dirs = os.listdir(path+"RenpyOriginalScript\\")
for dir in dirs:
    print(dir)
    list = []
    f1 = open(path+"RenpyOriginalScript\\"+dir,"r",encoding="utf-8") #encode
    text_lines = f1.readlines()
    for line in text_lines:
        if line[0] == "\"":
            list.append(line[1:len(line)-2])
            continue
        elif "$" not in line and "label" not in line and "menu" not in line and "jump" not in line and "scene" not in line and "show" not in line and "hide" not in line and "play" not in line and "voice" not in line : #起始索引
            list.append(line[line.find("\"")+1:len(line)-2])
            continue
    f1.close()
    with open(path+"ExtractInnerQuota\\"+dir.strip(".txt")+"(eiq).txt","w",encoding="utf-8") as f2:
        for ScriptText in list:
            f2.write(ScriptText+"\n")